package com.imooc.controller;

import com.imooc.pojo.Stu;
import com.imooc.service.StuService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RestController;
import springfox.documentation.annotations.ApiIgnore;

@RestController
//@ApiIgnore         //隐藏controller
public class HelloController {

    @Autowired
    private StuService stuService;

    @GetMapping("/hello")
    public Object hello(){
        return "Hello";
    }

    @GetMapping("/getstu/{id}")
    public Object getstu(@PathVariable int id){
        return stuService.getStuInfo(id);
    }
}
